﻿using FluentNHibernate.Mapping;

namespace Subscriber1
{
    public class SagaHeaderDataMap : ClassMap<SagaHeader>
    {
        public SagaHeaderDataMap()
        {
            Id(x => x.Id);
            Map(x => x.OriginalMessageId);
            Map(x => x.Originator);

            Map(x => x.ProcessId);
            Map(x => x.CompletionMessage);
            Map(x => x.BeginDate);
            Map(x => x.EndDate);

            HasMany(x => x.Children)
                .KeyColumn("Id")
                .Cascade.All()
                .Inverse();
        }
    }

    public class SagaUpdatesDataMap : ClassMap<SagaUpdates>
    {
        public SagaUpdatesDataMap()
        {
            Id(x => x.Id);
            Map(x => x.ProcessId);
            Map(x => x.SomeMoreInformation);
            Map(x => x.SomeMoreInformation2);
        }
    }

    /*References(x => x.Parent)
    .Column("SomeProcessId");*/
}
